﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>窗体</title>
    <link href="../../Scripts/easyUI145/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../../Scripts/easyUI145/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/easyUI145/jquery.min.js" type="text/javascript"></script>
    <script src="../../Scripts/easyUI145/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Scripts/config.js" type="text/javascript"></script>
    <script src="../../Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../Comm/Gener.js" type="text/javascript"></script>
    <script src="DDLBar.js" type="text/javascript"></script>

    <link href="../../Style/skin/adminfont/iconfont.css" rel="stylesheet" />
    <link href="../../Style/skin/css/Default.css" rel="stylesheet" />
    <script src="../EnumLab.js"></script>
    <script type="text/javascript">

        var winDocModel = "Tab";
        $(function () {

            var menuNo = GetQueryString("MenuNo");
            InitBar(winDocModel);

        });

        function Save() {

            $("#Msg").html("正在创建,请稍后......");

            var name = document.getElementById("TB_Name").value;
            if (name == "" || name == null) {
                $("#Msg").html("名称不能为空...");
                return;
            }

            //更新节点表单类型.
            var menuNo = GetQueryString("MenuNo");
            var en = new Entity("BP.CCFast.Portal.WindowTemplate");
            en.PageID = menuNo;
            en.Name = name;
            en.WinDocModel = winDocModel; //窗口内容模式.
            en.Icon = "icon-info";
            en.ColSpan = 2;
            en.Insert();


            //从表信息.
            var enDtl = new Entity("BP.CCFast.Portal.WindowExt.TabDtl");
            enDtl.RefPK = en.No;
            enDtl.Name = "待办";
            enDtl.Exp0 = "SELECT NodeName AS '节点名', COUNT(*) as '数量' FROM WF_GenerWorkerlist WHERE FK_Emp='@WebUser.No' AND IsPass=0 GROUP BY NodeName";
            enDtl.FontColor = "Yellow";
            enDtl.WindowsShowType = 0; //饼图
            enDtl.Insert();

            enDtl = new Entity("BP.CCFast.Portal.WindowExt.TabDtl");
            enDtl.RefPK = en.No;
            enDtl.Name = "在途";
            enDtl.Exp0 = "SELECT NodeName AS '节点名', COUNT(*) as '数量' FROM WF_GenerWorkerlist WHERE FK_Emp='@WebUser.No' AND IsPass=1 GROUP BY NodeName";
            enDtl.FontColor = "Blue";
            enDtl.WindowsShowType = 1; //折线图
            enDtl.Insert();

            enDtl = new Entity("BP.CCFast.Portal.WindowExt.TabDtl");
            enDtl.RefPK = en.No;
            enDtl.Name = "退回";
            enDtl.Exp0 = "SELECT FlowName AS '流程名', COUNT(*) as '数量' FROM  WF_GenerWorkFlow A,  WF_GenerWorkerlist B WHERE B.FK_Emp='@WebUser.No' AND B.IsPass=0 AND A.WorkID=B.WorkID AND A.WFState=5  GROUP BY FlowName";
            enDtl.FontColor = "Red";
            enDtl.WindowsShowType = 2; //柱状图
            enDtl.Insert();

            enDtl = new Entity("BP.CCFast.Portal.WindowExt.TabDtl");
            enDtl.RefPK = en.No;
            enDtl.Name = "已完成";
            enDtl.Exp0 = "SELECT FlowName AS '流程名', COUNT(*) as '数量'  FROM  WF_GenerWorkFlow  WHERE Emps LIKE '@WebUser.No' AND WFState=3  GROUP BY FlowName";
            enDtl.FontColor = "#8c531b";
            enDtl.WindowsShowType = 3; //表格
            enDtl.Insert();

            SetHref("../../Comm/En.htm?EnName=BP.CCFast.Portal.WindowExt." + winDocModel + "&No=" + en.No);

        }
    </script>
</head>
<body>
    <form id="CCForm">
        <div id="bar">
        </div>
        <fieldset>

            <legend>创建窗体 </legend>
            <ul>
                <li> 标题</li>
                <li><input type="text" id="TB_Name" value="Tab标签页" placeholder="不能为空" /> </li>
                <li> <div id="Msg"></div> </li>
            </ul>

            <legend>说明</legend>
            <ul>
                <li><img src="Tab.png" class="HelpImg" /> </li>
            </ul>
        </fieldset>
    </form>
</body>
</html>